import java.io.*;
import java.util.*;
import java.awt.Color;
import java.awt.Image;
import java.awt.image.*;

import javax.imageio.ImageIO;
public class ImgMapLoader extends MapLoader {
	
	ArrayList<Image> tileImages;
	public void load(String file) 
	{ 
		tileImages = new ArrayList<Image>();
		File mapFile = new File(file);
		String tileFileName = mapFile.getName() + ".txt"; //read tile config file by same name
		tileImages = new ArrayList<Image>();
		
		
		
	}
	
	private void loadTileData(File tileFile)
	{
		Scanner file = null;
		try {
			file = new Scanner(tileFile);
		} catch (FileNotFoundException e) {
			e.printStackTrace();
		}
		
		while(file.hasNextLine())
		{
			tileImages.add(ResourceManager.getManager().load(file.nextLine()));
		}
		
	}
	
	private void loadMapData(File mapFile)
	{
		BufferedImage img = null;
		try {
			img = ImageIO.read(mapFile);
		} catch (IOException e) {
			e.printStackTrace();
		}
		int[] pixels = new int[img.getWidth() * img.getHeight()];
		mapData = new Tile[img.getWidth()][img.getHeight()];
		PixelGrabber grab = new PixelGrabber(img,0,0,img.getWidth(),img.getHeight(),pixels,0,img.getWidth());
		grab.startGrabbing();
		
		for(int x = 0; x < img.getWidth(); x++)
			for(int y = 0; y < img.getHeight(); y++)
			{
				Color col = new Color(pixels[x + y * mapData.length]);
			
			} 
	}
}
